<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改课程名称')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-main-edit" th:object="${tbTotalCourseMain}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">课程代码：</label>
                <div class="col-sm-8">
                    <input name="courseCode" th:field="*{courseCode}" class="form-control" type="text" readonly required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">课程名称：</label>
                <div class="col-sm-8">
                    <input name="courseName" th:field="*{courseName}" class="form-control" type="text" readonly required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">学时：</label>
                <div class="col-sm-8">
                    <input name="studyTime" th:field="*{studyTime}" class="form-control" type="number" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">学分：</label>
                <div class="col-sm-8">
                    <input name="studyScore" th:field="*{studyScore}" class="form-control" type="number" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">教师姓名：</label>
                <div class="col-sm-8">
                    <select class="form-control" name="teacherName" id="teacherName" th:with="teacherNames=${@user.getUserName()}" required th:field="*{teacherName}">
                        <option value="">请选择</option>
                        <option th:each="teacherName : ${teacherNames}" th:text="${teacherName.userName}" th:value="${teacherName.userName}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">年级：</label>
                <div class="col-sm-8">
                    <input name="tbClass" th:field="*{tbClass}" class="form-control" type="text" required>
                </div>
            </div>
            <!--字典的使用-->
            <div class="form-group">
                <label class="col-sm-3 control-label">专业：</label>
                <div class="col-sm-8">
                    <select th:field="*{profession}" name="profession" class="form-control m-b" th:with="type=${@dict.getType('sys_profession')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "website/totalcourse";
        $("#form-main-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-main-edit').serialize());
            }
        }
    </script>
</body>
</html>